/**
 * Created by Administrator on 2017/12/8.
 */
//$(".goBack").click(function(){
//    window.history.go(-1)
//});
var xpHome = new Vue({
    el:'#app',
    data:{
        imgBaseUrl: nUrls.imgBaseUrl,//图片路径
        showGoodsList:[],//推荐信息列表
    },
    methods: {
        getImage:function(url){//加载图片  处理 url为空 加载出错
            if(url){
                return xpHome.imgBaseUrl+url;
            }
        },
        goFenXiang: function () {//到二维码分享页面
            window.location.href = "./fenXiang.html";
        },
        getGoodsInfo:function(){
            $.ajax({
                url: nUrls.getThreeGoodsInfo,
                type:'post',
                success:function(data){
                    var result = eval('('+data+')');
                    if(result && result.code == 200){
                        //console.log(result)
                        xpHome.showGoodsList = result.data;
                        //console.log(xpHome.showGoodsList);
                    }
                },
                error:function(){
                    console.log("没有更多信息")
                }
            });
        },
        goIndex:function(){  //到首页
            window.location.href = "../../index.html";
        },
        goOrderInfo:function(pageType){ //到订单详情页
            window.location.href = "../my_center_detail/indent/indent.html?flag="+pageType;
        },
        goDetail: function (good_id) {//到商品详情页
            window.location.href = "../detail/goods_detail.html?id="+good_id;
        },
        goOnLine:function(){  //断网刷新
            nUtils.onLine();
        }
    }
});
$(function(){
    xpHome.getGoodsInfo()
})